Skip to content

Remove unnecessary pub enum glob-imports from rustc_middle::ty #132580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

compiler-errors
Copy link
Member

We used to have an idiom in the compiler where we'd prefix or suffix all the variants of an enum, for example BoundRegionKind, with something like Br, and then glob-import that enum variant directly.

@Noratrieb brought this up, and I think that it's easier to read when we just use the normal style EnumName::Variant.

This PR is a bit large, but it's just naming.

The only somewhat opinionated change that this PR does is rename BorrowKind::Imm to BorrowKind::Immutable and same for the other variants. I think these enums are used sparingly enough that the extra length is fine.

r? @Noratrieb or reassign

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2024

HIR ty lowering was modified

cc @fmease

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@compiler-errors
Copy link
Member Author

compiler-errors commented Nov 3, 2024

I also understand that the size of these commits are kinda unequal so I'm happy to split out the smaller ones 👍

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@Noratrieb
Copy link
Member

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Nov 5, 2024

📌 Commit d458f85 has been approved by Noratrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2024
@bors
Copy link
Collaborator

bors commented Nov 5, 2024

⌛ Testing commit d458f85 with merge 096277e...

@bors
Copy link
Collaborator

bors commented Nov 5, 2024

☀️ Test successful - checks-actions
Approved by: Noratrieb
Pushing 096277e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 5, 2024
@bors bors merged commit 096277e into rust-lang:master Nov 5, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 5, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (096277e): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary 3.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 779.675s -> 780.065s (0.05%)
Artifact size: 335.31 MiB -> 335.31 MiB (0.00%)

@compiler-errors compiler-errors deleted the globs branch November 5, 2024 14:34
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 7, 2024
Remove unnecessary pub enum glob-imports from `rustc_middle::ty`

We used to have an idiom in the compiler where we'd prefix or suffix all the variants of an enum, for example `BoundRegionKind`, with something like `Br`, and then *glob-import* that enum variant directly.

`@noratrieb` brought this up, and I think that it's easier to read when we just use the normal style `EnumName::Variant`.

This PR is a bit large, but it's just naming.

The only somewhat opinionated change that this PR does is rename `BorrowKind::Imm` to `BorrowKind::Immutable` and same for the other variants. I think these enums are used sparingly enough that the extra length is fine.

r? `@noratrieb` or reassign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants